const fs=require('fs');
let data='hello world';
let writerStream=fs.createWriteStream('test.txt');
writerStream.write(data,'utf8');
writerStream.end();
writerStream.on('finish',()=>console.log('finish'));
writerStream.on('error',(err)=>console.log(err.stack));
